#!/usr/bin/env python3
# -*- coding: utf-8 -*-

""" 文件描述内容 """

__auther__ = 'igofishing'


import numpy as np
from matplotlib import pyplot as plt


x = np.linspace(-4, 6, 50)

y = x * 14 + 5


plt.figure(1)
plt.plot(x, y, color='grey', linestyle='--')


# 指定x轴, y轴的范围
plt.xlim((0, 10))
# plt.ylim((0, 20))

# 给x轴, y轴label
plt.xlabel('look look x')
plt.ylabel('look look y')


# 给x轴, y轴添加区间标示
plt.xticks([0, 2, 4, 6, 8, 10], ['0', 'go', 'come', 'well', 'good', 'perfect'])


# 改变坐标轴的显示形式

# gca -> 'get current axis'
ax = plt.gca()

ax.spines['right'].set_color('none')    # 隐藏右侧边框
ax.spines['top'].set_color('none')      # 隐藏上部边框


ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')

ax.spines['left'].set_position(('data', 0))     # 设置左侧边框锁定位置 0
ax.spines['bottom'].set_position(('data', 0))   # 设置底部边框锁定位置 0


plt.show()

